import {lazy} from "react"
import {Navigate} from "react-router-dom"
const Home = lazy(()=>import("../pages/Index/Home"))
const Index = lazy(()=>import("../pages/Index/Index"))
const Dtail = lazy(()=>import("../pages/detail"))
const Shopcar = lazy(()=>import("../pages/Index/Shopcar"))
const Login  = lazy(()=>import("../pages/Login"))
const NotFind = lazy(()=>import("../pages/NotFind"))
const Indexrouter = [
    {
        path:"/index/home",
        element:<Home></Home>
    },
    {
        path:"/index/shopcar",
        element:<Shopcar></Shopcar>
    },
    {
        path:"/index",
        element:<Navigate to="/index/home"></Navigate>
    }
]
const routerconfig = [
    {
        path:"/index",
        element:<Index></Index>,
        children:Indexrouter
    },
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/detail",
        element:<Dtail></Dtail>
    },
    {
        path:"/",
        element:<Navigate to="/index"></Navigate>
    },
    {
        path:"*",
        element:<NotFind></NotFind>
    }
]
export default routerconfig